

let fs = require("fs");
let {mapData} = require("./mapdata");




let { categories, groups, locations } = mapData




// 分类

let cats = {}

for (let catid in categories) {
    cats[categories[catid].title] = []
}

locations.forEach(info => {
    let {category_id,title,description,latitude,longitude} = info
    let catTitle = categories[category_id].title
    cats[catTitle].push({
        category:catTitle,
        title,description,latitude,longitude
    })
});


fs.writeFileSync("./cat.js", "let cats = " + JSON.stringify(cats))